Counts the occurences of each number in a vector. The vector must contain positive integers 0 1 2 .. n. The output vector contains the occurences of each integer starting from 0.
NOTE: Keep the vector length reasonable! In 6 MB RAM you'll expect the Mac to crash if you are processing vector lengths greater than about 10 000. Few thousands seems safe. To process bigger vectors increase application's memory partition.
(count-distribution '#(1 1 2 2 3))
--> #(0 2 2 1)
zero zeros
two ones
two twos
one three
To count distributions of other than positive-integer vectors use vector-round to scale the vector into a suitable range.